package cc.realxyq.springboot.actuator.endpoint;

import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.annotation.WriteOperation;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.Map;

/**
 * @author : [buleing]
 * @version : [v1.0]
 * @description : [自定义endpoint]
 * @createTime : [2021/6/10 18:49]
 * @updateUser : [buleing]
 * @updateTime : [2021/6/10 18:49]
 * @updateRemark : [说明本次修改内容]
 */
@Component
@Endpoint(id="myService")
public class MyEndpoint {

    @ReadOperation
    public Map getDockerInfo(){
        return Collections.singletonMap("dockerInfo","aljfaljfal;jfda;fdjalkfj");
    }

    @WriteOperation
    public void stopDocker(){
        System.out.println("Strop ");
    }
}
